namespace Expect.Documentation
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Introduction", Path="\\Introduction.expect")]
    public partial class IntroductionContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Introduction.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void IntroductionClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void IntroductionClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void Introduction_WhatIsExpectFramework()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_WhatIsExpectFramework(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="What is Expect Framework ?")]
        public virtual void Get_WhatIsExpectFramework(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "What is Expect Framework ?";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 2
            fixture.WithRow("Expect is a tool intended to write executable specifications. It means that you w" +
                    "rite a specification that you could execute on your system.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 4
            fixture.WithRow("The best way to document Expect was to use Expect itself, this way we have in one" +
                    " single shot a documentation, a demonstrative sample and a suite of integration " +
                    "tests !");
#line 5
            fixture.WithRow("So if you read this in a word document, be aware that the document was generated " +
                    "from the executable specifications...");
#line 6
            fixture.WithRow("The source code generating this document is available on codeplex (http://expect." +
                    "codeplex.com) in the downloads.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 8
            fixture.WithRow("This document will first explain the basic concepts, and then detail the way spec" +
                    "ifications are binded to your application, as well as other stuff like document " +
                    "generation.");
#line hidden
            fixture.EndRun();

        }
        
        // TestComment
        [TestMethod()]
        public virtual void Introduction_GettingStarted()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_GettingStarted(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Getting started")]
        public virtual void Get_GettingStarted(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Getting started";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 11
            fixture.WithRow("To get started and experiment with the tool, create a new test project in Visual " +
                    "Studio.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 13
            fixture.WithRow("With Expect, specifications are contained in file with \".expect\" extension. You c" +
                    "ould add a new specification file very easily by right clicking on your test pro" +
                    "ject and selecting \"Add New Item > Expect specification\".");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<ImageDescriptionFixture>();
#line 14
            fixture.WithRow("images\\add expect item.png");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 16
            fixture.WithRow("Expect rely on a unit test framework to execute your specifications. In your \".ex" +
                    "pect\" file, some parts are executed, and some are not. Line starting with \"#\" ar" +
                    "e considered as descriptions and they are not interpreted by Expect.");
#line 17
            fixture.WithRow("!For example, Create a new specification and replace the content with the followi" +
                    "ng:!");
#line 18
            fixture.WithRow("{{");
#line 19
            fixture.WithRow("This sentence is executed");
#line 20
            fixture.WithRow("");
#line 21
            fixture.WithRow("#This sentence is not executed because it starts with a \"#\" in the source.");
#line 22
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 24
            fixture.WithRow("Within Visual Studio you must end up with this :");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<ImageDescriptionFixture>();
#line 25
            fixture.WithRow("images\\intro 1.png");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 26
            fixture.WithRow("In Expect, pieces of code that maps to your specifications are called \"Fixtures\"." +
                    " The red squiggle (only available in VS2010) indicate that Expect don\'t find a f" +
                    "ixture for the sentence.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 28
            fixture.WithRow("When you execute your specifications, if Expect could not resolve one or more fix" +
                    "ture, the test run will end up with an \"inconclusive\" result.");
#line 29
            fixture.WithRow("Try running the generated test (use the main menu Test -> Windows -> Test view in" +
                    " Visual Studio) and look at the result in Visual Studio \"Test Result\" view.");
#line 30
            fixture.WithRow("Your test run should show an inconclusive result. If you look at the test run det" +
                    "ails, you will see that Expect provide some clues about what goes wrong.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 32
            fixture.WithRow("The tool comes with some helpers to help you generate fixture code. ");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 34
            fixture.WithRow("To try it, you could right click on the unresolved fixture and use the context me" +
                    "nu to select \"Container -> Create method\". ");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<ImageDescriptionFixture>();
#line 35
            fixture.WithRow("images\\intro 2.png");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 36
            fixture.WithRow("Expect will open the container class associated with your specification and gener" +
                    "ate a method with this :");
#line 37
            fixture.WithRow("{{");
#line 38
            fixture.WithRow("[FixtureHint(\"This sentence is executed\")]");
#line 39
            fixture.WithRow("public void ThisSentenceIsExecuted()");
#line 40
            fixture.WithRow("{");
#line 41
            fixture.WithRow("\tthrow new NotImplementedException();");
#line 42
            fixture.WithRow("}");
#line 43
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 45
            fixture.WithRow("In VS 2010 you could also use smart-tags:");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<ImageDescriptionFixture>();
#line 46
            fixture.WithRow("images\\intro 3.png");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 48
            fixture.WithRow("If you run this specification again, the test will fail because of the exception " +
                    "thrown by the fixture. If you remove the \"throw new NotImplementedException();\" " +
                    "and run the test again, this time it will succeed.");
#line 49
            fixture.WithRow("You implement fixture just as you would implement tests with the unit test framew" +
                    "ork.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 51
            fixture.WithRow("As you probably noticed, you could differentiate descriptions and executable part" +
                    "s in Visual Studio (with syntax higlighting) and also in the generated report (b" +
                    "y applying different Word styles).");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 53
            fixture.WithRow("There are several kind of fixtures to help you have a syntax in tune with what yo" +
                    "u have to express. For example, some fixtures could be rendered as tables like t" +
                    "his one:");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 54
            fixture.WithRow("This part is executed, including the following table");
#line 55
            fixture.WithRow("My column", "Another column");
#line 56
            fixture.WithRow("1", "2");
#line 57
            fixture.WithRow("3", "4");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 59
            fixture.WithRow("Report will be explained later in this document but we will give you a brief over" +
                    "view here. To generate a document from your specifications you have to prepare a" +
                    " Word document that will be used as a template.");
#line 60
            fixture.WithRow("In this document, you must prepare the styles that Expect will use later to gener" +
                    "ate the specification document. Once your template is ready and Expect configure" +
                    "d, you will be able to generate the document from Visual Studio or from the comm" +
                    "and line.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 62
            fixture.WithRow("The remaining of this document will go into details about using Expect and how to" +
                    " generate a document from your specification.");
#line hidden
            fixture.EndRun();

        }
    }
}
